﻿using System;
using MvvmFoundation.Wpf;

namespace WpfApplication1.Wpf
{
    public class CommandViewModel : ViewModel
    {
        public CommandViewModel(Action execute)
        {
            Command = new RelayCommand(execute);
        }

        public CommandViewModel(Action execute, Func<bool> canExecute)
        {
            Command = new RelayCommand(execute, canExecute);
        }

        public RelayCommand Command { get; private set; }
    }

    public class CommandViewModel<T> : ViewModel
    {
        public CommandViewModel(Action<T> execute)
        {
            Command = new RelayCommand<T>(execute);
        }

        public CommandViewModel(Action<T> execute, Predicate<T> canExecute)
        {
            Command = new RelayCommand<T>(execute, canExecute);
        }

        public RelayCommand<T> Command { get; private set; }
    }
}